import { PublishStatus, UpdateShopwindow, updateStatus, mint } from "../api/cert";


const SHELVES_STATUS_ARRAY = [
  {
    label: "上架证书",
    status: 1,
    function: {
      key: "status",
      value: 1,
      call: (ids) => updateStatus({
        ids: ids,
        status: 1
      })
    }
  },
  {
    label: "下架证书",
    function: {
      key: "status",
      value: 0,
      call: (ids) => updateStatus({
        ids: ids,
        status: 0
      })
    }
  }
];


const DEPARTMENT_SEARCH = {
  pageNum: 1,
  assignTypeId: 2,
  // 电邀部门Id
  invitationId: undefined,
  // 城市id
  cityId: 0,
  // 派单数量
  assignCount: 1,
};

const DEPARTMENT_SEARCH_BY_HISTORY_SEARCH = {
  pageNum: 1,
  assignType: undefined,
  // 电邀部门Id
  invitationId: undefined,
  // 城市id
  cityId: undefined,
  // 派单数量
  startTime: undefined,
  endTime: undefined,
};


const OPERATION_STATUS_ARRAY = [
  ...SHELVES_STATUS_ARRAY,
  {
    label: "铸造",
    status: 1,
    function: {
      key: "mintStatus",
      value: 1,
      call: (ids) => mint({
        id: ids,
      })
    }
  }

];

/**
 * 员工
 */
const DEFAULT_ADMIN = {
  id: null,
  staffName: null,
  depart: 1,
  status: 0,
  newPeople: 1,
  homeAddress: "",
  post: 0,
  areaId: null,
  cityId: null,
  leaveStart: "",
  leaveEnd: "",
  tanmaId: null, // 关联电邀id
};


const STATUS_OPTIONS = [
  {
    label: '待付款',
    value: 0
  },
  {
    label: '已完成',
    value: 1
  },
  {
    label: '已关闭',
    value: -1
  }
];

const PUBLISH_STATUS_OPTIONS = [{
  value: 1,
  label: '正常'
}, {
  value: 0,
  label: '作废'
}];
const ORDER_TYPE_OPTIONS = [
  {
    label: '正常订单',
    value: 0
  },
  {
    label: '秒杀订单',
    value: 1
  }
];
const SOURCE_TYPE_OPTIONS = [
  {
    label: 'PC订单',
    value: 0
  },
  {
    label: 'APP订单',
    value: 1
  }
];
const OPERATION_OPTIONS = [
  // {
  //   label: "批量发货",
  //   value: 1
  // },
  {
    label: "关闭订单",
    value: 2
  },
  // {
  //   label: "删除订单",
  //   value: 3
  // }
];

const PAY_TYPE_ARRAY = [
  "未知（未支付）",
  "微信",
  "支付宝"
];

const PLATEFORM_ORDER_TYPE_ARRAY = [
  "PC",
  "Android",
  "WAP",
  "微商城",
  "IOS"
];

const ORDER_TYPE = [
  "普通订单",
  "货到付款"
];

const ORDER_STATUS = [
  "取消订单",
  "未支付",
  "已支付"
];

const WITHDRAWAL_STATUS = [
  "未提现",
  "已提现"
];

const CAST_STATUS = [
  "铸造失败",
  "铸造成功"
];

/**
 * 百分比
 */
const PERCENTAGE = [
  "color-success",
  "color-danger"
];

/**
 * 提现列表
 * 提现状态
 */
const CASTING_STATUS = [
  "提现失败",
  "提现成功"
];

const CLIENT_TYPE = [
  { text: '前道', value: 0 },
  { text: '后道', value: 1 },
  { text: '前道+', value: 2 },
];

/**
 * 
 */
const ASSIGN_ORDER_TYPE = [  
  {value: "首访福利", id: 1},  
  {value: "首访plus", id: 2},  
  // {value: "回访", id: 3},  
  {value: "回访plus", id: 4}  
];

const ASSIGN_ORDER_PAGE = {
  1: "sea",
  2: "normal",
  4: "normal"
};

const WAIT_TIME = [
  7000, // 0个
  9000, // 10个
  11000, // 2o个
  12000, // 30
  14000, // 40
  16000, // 50
  18000, // 60
];

const datePicker = {
  shortcuts: [
    {
      text: "半天",
      onClick(picker) {
        const end = new Date();
        const start = new Date();
        end.setTime(end.getTime() + 3600 * 1000 * 9);
        picker.$emit("pick", [start, end]);
      },
    },
    {
      text: "最近一周",
      onClick(picker) {
        const end = new Date();
        const start = new Date();
        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
        picker.$emit("pick", [start, end]);
      },
    },
    {
      text: "最近一个月",
      onClick(picker) {
        const end = new Date();
        const start = new Date();
        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
        picker.$emit("pick", [start, end]);
      },
    },
  ],
};

export {
  DEFAULT_ADMIN,
  CLIENT_TYPE,
  ASSIGN_ORDER_PAGE,
  DEPARTMENT_SEARCH_BY_HISTORY_SEARCH,
  ASSIGN_ORDER_TYPE,
  DEPARTMENT_SEARCH,
  PERCENTAGE,
  CASTING_STATUS,
  PUBLISH_STATUS_OPTIONS,
  WITHDRAWAL_STATUS,
  OPERATION_STATUS_ARRAY,
  SOURCE_TYPE_OPTIONS,
  ORDER_STATUS,
  CAST_STATUS,
  ORDER_TYPE,
  OPERATION_OPTIONS,
  PAY_TYPE_ARRAY,
  PLATEFORM_ORDER_TYPE_ARRAY,
  ORDER_TYPE_OPTIONS,
  STATUS_OPTIONS,
  WAIT_TIME
}